﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Demo1
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (ful.HasFile)
            {
               string a = ful.FileName;
                if (a.EndsWith(".jpg")||a.EndsWith(".jpeg")||a.EndsWith(".png"))
                {
                    string b = Server.MapPath(@"~\img\") + a;
                    ful.SaveAs(b);
                    Image1.ImageUrl = @"~\img\" + a;
                    Image1.Visible = true;
                }
            }
        }
    }
}